home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / nice203.arc / DEMO.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1983-12-17  |  5.1 KB  |  184 lines

  1. 10  ' This program demonstrates the NicePrint features
  2. 20  '
  3. 30  CLS
  4. 40  PRINT "NicePrint demonstration program"
  5. 50  PRINT
  6. 60  PRINT "If you have not already done so,"
  7. 70  PRINT "load one of the NicePrint COM files"
  8. 80  PRINT "(by typing its name in DOS)."
  9. 90  PRINT
  10. 100  PRINT "This program will type out "
  11. 110  PRINT "samples of the NicePrint features"
  12. 120  PRINT "in NICE mode, and then print out"
  13. 130  PRINT "the same text in normal mode."
  14. 140  PRINT
  15. 150  PRINT
  16. 160  PRINT
  17. 170  PRINT "Now ready the printer and press"
  18. 180  PRINT "F1 if you have an EPSON or IBM"
  19. 190  PRINT "graphics printer and loaded NICE,"
  20. 200  PRINT "NICENSML, or NICENWID; or press"
  21. 210  PRINT "F2 if you have a GEMINI and loaded"
  22. 220  PRINT "GNICE, GNICEWID, or GNICESML"
  23. 230  GEMINI = -1
  24. 240  KEY(1) ON:KEY(2) ON
  25. 250  ON KEY(1) GOSUB 12000
  26. 260  ON KEY(2) GOSUB 13000
  27. 270  IF GEMINI<>-1 THEN 290
  28. 280  GOTO 270
  29. 290  OPEN "lpt1:" AS #1
  30. 295  PRINT#1,CHR$(27);"@";: 'RESET PRINTER
  31. 300  FOR QUAL = 0 TO 1 :' repeat in low-quality mode
  32. 310  '
  33. 320  PRINT #1,CHR$(27);"x2":' set serif roman style
  34. 330  '
  35. 340  GOSUB 1000: ' print out all pitches
  36. 350  PRINT #1," "
  37. 360  GOSUB 2000: ' print out all character styles
  38. 370  '
  39. 380  PRINT #1,CHR$(27);"4";:' NOW SET ITALIC MODE
  40. 390  GOSUB 2000: ' print all character styles italicized
  41. 400  '
  42. 410  PRINT #1,CHR$(27);"5";: ' clear italic mode
  43. 420  '
  44. 425  PRINT #1,CHR$(27);"x2"; : ' set back to first style
  45. 426  '
  46. 430  PRINT#1," ":PRINT#1," ":GOSUB 8000 : ' print out feature sample
  47. 431  '
  48. 432  PRINT #1,CHR$(12);: ' page eject
  49. 433  '
  50. 434  PRINT #1,CHR$(27);"xB";: ' select BIG mode
  51. 435  '
  52. 436  GOSUB 8000 : ' print out sample in BIG mode
  53. 437  '
  54. 438  PRINT #1,CHR$(27);"xN";: ' cancel BIG mode
  55. 439  '
  56. 440  PRINT #1," ";: ' skip a space
  57. 441  '
  58. 450  PRINT #1,"International characters:"
  59. 460  GOSUB 3000
  60. 470  '
  61. 480  PRINT #1,CHR$(27);"x1";: 'disable NicePrint
  62. 490  PRINT #1,CHR$(12);:' PAGE EJECT
  63. 500  NEXT QUAL
  64. 510  CLS
  65. 520  PRINT "Now type Ctrl-Alt-F10 to do a page"
  66. 530  PRINT "eject on the printer, and then type"
  67. 540  PRINT "Ctrl-Alt-F2 to restore the NICE "
  68. 550  PRINT "printing capability."
  69. 560  PRINT
  70. 570  PRINT "If you do not type Ctrl-Alt-F2,"
  71. 580  PRINT "then the printer will behave like"
  72. 590  PRINT "its usual self and not print out"
  73. 600  PRINT "NICE characters.
  74. 610  PRINT
  75. 620  PRINT
  76. 630  PRINT
  77. 640  STOP
  78. 1000  ' This subroutine prints out samples of all six pitchs
  79. 1010  '
  80. 1020  PITCH = 1:GOSUB 9000:' set Pica
  81. 1030  PRINT#1,"Standard Pica"
  82. 1040  '
  83. 1050  PITCH = 2:GOSUB 9000: ' set Elite
  84. 1060  PRINT#1,"Standard Elite"
  85. 1070  '
  86. 1080  PITCH = 3:GOSUB 9000:' set Condensed
  87. 1090  PRINT#1,"Standard Condensed"
  88. 1100  '
  89. 1110  PITCH = 4:GOSUB 9000: ' set Pica Enlarged
  90. 1120  PRINT#1,"Enlarged Pica"
  91. 1130  '
  92. 1140  PITCH = 5:GOSUB 9000: ' set Elite Enlarged
  93. 1150  PRINT #1,"Enlarged Elite"
  94. 1160  '
  95. 1170  PITCH = 6:GOSUB 9000: ' set Condensed Enlarged
  96. 1180  PRINT #1,"Condensed Enlarged"
  97. 1190  '
  98. 1200  PITCH = 1:GOSUB 9000:' return to Pica
  99. 1210  RETURN
  100. 1220  '
  101. 2000  ' This subroutine prints out all the character sets
  102. 2010  '
  103. 2020  FOR STYLE = 2 TO 7: ' all six NicePrint character styles
  104. 2030  '
  105. 2040  PRINT #1,CHR$(27);"x";CHR$(STYLE);: ' set style -- may also say
  106. 2050  '                                     chr$(27);"x2"
  107. 2060  FOR CHAR = 32 TO 90
  108. 2070  PRINT #1,CHR$(CHAR);
  109. 2080  NEXT CHAR
  110. 2090  PRINT #1," "
  111. 2100  FOR CHAR = 91 TO 126
  112. 2110  PRINT #1,CHR$(CHAR);
  113. 2120  NEXT CHAR
  114. 2130  PRINT #1," "
  115. 2140  NEXT STYLE
  116. 2150  RETURN
  117. 2160  '
  118. 3000  ' print out all 8 international character sets
  119. 3010  '
  120. 3020  PITCH = 3:GOSUB 9000:' Condensed pitch
  121. 3030  WIDTH#1, 132
  122. 3040  FOR R = 0 TO 8 : ' Eight international sets
  123. 3050  IF GEMINI = 1 THEN PRINT#1,CHR$(27);"7";CHR$(R);:' set for GEMINI
  124. 3060  IF GEMINI = 0 THEN PRINT#1,CHR$(27);"R";CHR$(R);:' set for IBM/EPSON
  125. 3070  '
  126. 3080  FOR CHAR = 32 TO 126
  127. 3090  PRINT #1,CHR$(CHAR);
  128. 3100  NEXT CHAR
  129. 3110  PRINT #1," "
  130. 3120  NEXT R
  131. 3121  IF GEMINI = 1 THEN PRINT#1,CHR$(27);"7";CHR$(0);: ' set normal
  132. 3122  IF GEMINI = 0 THEN PRINT#1,CHR$(27);"R";CHR$(0);
  133. 3130  RETURN
  134. 3140  '
  135. 8000  ' This subroutine prints out the line of subroutine 10000 in all
  136. 8010  ' possible pitches.
  137. 8020  '
  138. 8030  FOR PITCH = 1 TO 6
  139. 8035  IF PITCH<4 THEN WIDTH#1,96 ELSE WIDTH#1,48
  140. 8040  GOSUB 9000: ' set pitch
  141. 8050  GOSUB 10000:' print line
  142. 8060  NEXT PITCH
  143. 8070  RETURN
  144. 8080  '
  145. 9000  ' This subroutine sets the pitch.  IBM/EPSON commands to set the pitch
  146. 9010  ' are different from GEMINI commands to set the pitch.
  147. 9020  '
  148. 9030  IF GEMINI = 1 THEN 9500
  149. 9040  '
  150. 9050  ' IBM/EPSON pitch setting commands
  151. 9060  '
  152. 9070  PRINT #1,CHR$(27);"W";CHR$(0);: ' make sure enlarged mode is cleared
  153. 9080  PRINT #1,CHR$(18);:      ' make sure condensed mode is cleared
  154. 9085  PRINT#1,CHR$(27);"P";:' set pitch to pica to avoid mode conflict
  155. 9090  IF (PITCH=1) OR (PITCH=4) THEN PRINT#1,CHR$(27);"P";:' Pica
  156. 9100  IF (PITCH=2) OR (PITCH=5) THEN PRINT#1,CHR$(27);"M";:' Elite
  157. 9110  IF (PITCH=3) OR (PITCH=6) THEN PRINT#1,CHR$(15);    :' Condensed
  158. 9120  '
  159. 9130  IF PITCH>3 THEN PRINT#1,CHR$(27);"W";CHR$(1);:' set enlarged mode
  160. 9140  '
  161. 9150  RETURN : ' End of IBM/EPSON pitch set
  162. 9160  '
  163. 9500  ' GEMINI pitch set commands
  164. 9510  PRINT#1,CHR$(27);"W";CHR$(0);: ' make sure enlarged mode is cleared
  165. 9520  '
  166. 9530  P2 = PITCH:IF P2>3 THEN P2 = P2 - 3
  167. 9540  PRINT #1,CHR$(27);"B";CHR$(P2);:' 1=Pica, 2=Elite, 3=Condensed
  168. 9550  '
  169. 9560  IF PITCH>3 THEN PRINT#1,CHR$(27);"W";CHR$(1); : ' set enlarged mode
  170. 9570  RETURN
  171. 9580  '
  172. 10000  ' This  subroutine prints out a line with superscripts, subscripts
  173. 10001  ' and italics in it.
  174. 10002  ' It is the same for EPSON, IBM, and GEMINI
  175. 10003  '
  176. 10010  PRINT #1,"This";CHR$(27);"E test line";CHR$(27);"F contains SUPER";
  177. 10020  PRINT #1,CHR$(27);"S";CHR$(0);"SCRIPTS";CHR$(27);"T";",";
  178. 10030  PRINT #1,CHR$(27);"S";CHR$(1);" sub";CHR$(27);"T";"scripts, ";
  179. 10040  PRINT #1,CHR$(27);"-";CHR$(1);"underlining";CHR$(27);"-";CHR$(0);", ";
  180. 10050  PRINT #1,"and ";CHR$(27);"4";"ITALICS";CHR$(27);"5"
  181. 10060  RETURN
  182. 12000  GEMINI = 0:KEY(1) OFF:KEY(2) OFF:RETURN
  183. 13000  GEMINI = 1:KEY(1) OFF:KEY(2) OFF:RETURN
  184.